package cn.edu.lzu.service.impl;

import cn.edu.lzu.common.assist.ResponseResult;
import cn.edu.lzu.dao.FillRadItemMapper;
import cn.edu.lzu.entity.FillRadItem;
import cn.edu.lzu.service.FillRadItemService;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.sql.Timestamp;

/**
 * @PackageName: cn.edu.lzu.service.impl
 * @ClassName: FillRadItemServiceImpl
 * @Description: TODO
 * @Author: 张琦[QQ:3098086691]
 * @Date: 2020/4/6 16:48
 * @Version: 1.0
 */
@Service
@Transactional
public class FillRadItemServiceImpl implements FillRadItemService {
    @Resource
    private FillRadItemMapper fillRadItemMapper;

    @Override
    public ResponseResult fillRadItemValue(FillRadItem fillRadItem) {
        fillRadItem.setExamineTime(new Timestamp(System.currentTimeMillis()));
        int result=fillRadItemMapper.updRadItemStatusFilled(fillRadItem);
        ResponseResult responseResult=new ResponseResult();
        if(result==1){
            responseResult.setCode(1);
            responseResult.setMsg("数据写入成功！");
        }else{
            responseResult.setCode(0);
            responseResult.setMsg("数据写入失败");
        }
        return responseResult;
    }
}
